3.4.47 \(\int \frac {\sqrt {x} (A+B x)}{a+b x} \, dx\) [347]

Optimal. Leaf size=69 \[ \frac {2 (A b-a B) \sqrt {x}}{b^2}+\frac {2 B x^{3/2}}{3 b}-\frac {2 \sqrt {a} (A b-a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{b^{5/2}} \]

[Out]

2/3*B*x^(3/2)/b-2*(A*b-B*a)*arctan(b^(1/2)*x^(1/2)/a^(1/2))*a^(1/2)/b^(5/2)+2*(A*b-B*a)*x^(1/2)/b^2

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {81, 52, 65, 211} \begin {gather*} -\frac {2 \sqrt {a} (A b-a B) \text {ArcTan}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{b^{5/2}}+\frac {2 \sqrt {x} (A b-a B)}{b^2}+\frac {2 B x^{3/2}}{3 b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sqrt[x]*(A + B*x))/(a + b*x),x]

[Out]

(2*(A*b - a*B)*Sqrt[x])/b^2 + (2*B*x^(3/2))/(3*b) - (2*Sqrt[a]*(A*b - a*B)*ArcTan[(Sqrt[b]*Sqrt[x])/Sqrt[a]])/
b^(5/2)

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 81

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin {align*} \int \frac {\sqrt {x} (A+B x)}{a+b x} \, dx &=\frac {2 B x^{3/2}}{3 b}+\frac {\left (2 \left (\frac {3 A b}{2}-\frac {3 a B}{2}\right )\right ) \int \frac {\sqrt {x}}{a+b x} \, dx}{3 b}\\ &=\frac {2 (A b-a B) \sqrt {x}}{b^2}+\frac {2 B x^{3/2}}{3 b}-\frac {(a (A b-a B)) \int \frac {1}{\sqrt {x} (a+b x)} \, dx}{b^2}\\ &=\frac {2 (A b-a B) \sqrt {x}}{b^2}+\frac {2 B x^{3/2}}{3 b}-\frac {(2 a (A b-a B)) \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\sqrt {x}\right )}{b^2}\\ &=\frac {2 (A b-a B) \sqrt {x}}{b^2}+\frac {2 B x^{3/2}}{3 b}-\frac {2 \sqrt {a} (A b-a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{b^{5/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 63, normalized size = 0.91 \begin {gather*} \frac {2 \sqrt {x} (3 A b-3 a B+b B x)}{3 b^2}+\frac {2 \sqrt {a} (-A b+a B) \tan ^{-1}\left (\frac {\sqrt {b} \sqrt {x}}{\sqrt {a}}\right )}{b^{5/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sqrt[x]*(A + B*x))/(a + b*x),x]

[Out]

(2*Sqrt[x]*(3*A*b - 3*a*B + b*B*x))/(3*b^2) + (2*Sqrt[a]*(-(A*b) + a*B)*ArcTan[(Sqrt[b]*Sqrt[x])/Sqrt[a]])/b^(
5/2)

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 58, normalized size = 0.84

method result size
derivativedivides \(\frac {\frac {2 b B \,x^{\frac {3}{2}}}{3}+2 A b \sqrt {x}-2 B a \sqrt {x}}{b^{2}}-\frac {2 a \left (A b -B a \right ) \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{b^{2} \sqrt {a b}}\) \(58\)
default \(\frac {\frac {2 b B \,x^{\frac {3}{2}}}{3}+2 A b \sqrt {x}-2 B a \sqrt {x}}{b^{2}}-\frac {2 a \left (A b -B a \right ) \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{b^{2} \sqrt {a b}}\) \(58\)
risch \(\frac {2 \left (b B x +3 A b -3 B a \right ) \sqrt {x}}{3 b^{2}}-\frac {2 a \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right ) A}{b \sqrt {a b}}+\frac {2 a^{2} \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right ) B}{b^{2} \sqrt {a b}}\) \(71\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*x^(1/2)/(b*x+a),x,method=_RETURNVERBOSE)

[Out]

2/b^2*(1/3*b*B*x^(3/2)+A*b*x^(1/2)-B*a*x^(1/2))-2*a*(A*b-B*a)/b^2/(a*b)^(1/2)*arctan(b*x^(1/2)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 58, normalized size = 0.84 \begin {gather*} \frac {2 \, {\left (B a^{2} - A a b\right )} \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b} b^{2}} + \frac {2 \, {\left (B b x^{\frac {3}{2}} - 3 \, {\left (B a - A b\right )} \sqrt {x}\right )}}{3 \, b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x^(1/2)/(b*x+a),x, algorithm="maxima")

[Out]

2*(B*a^2 - A*a*b)*arctan(b*sqrt(x)/sqrt(a*b))/(sqrt(a*b)*b^2) + 2/3*(B*b*x^(3/2) - 3*(B*a - A*b)*sqrt(x))/b^2

________________________________________________________________________________________

Fricas [A]
time = 1.30, size = 129, normalized size = 1.87 \begin {gather*} \left [-\frac {3 \, {\left (B a - A b\right )} \sqrt {-\frac {a}{b}} \log \left (\frac {b x - 2 \, b \sqrt {x} \sqrt {-\frac {a}{b}} - a}{b x + a}\right ) - 2 \, {\left (B b x - 3 \, B a + 3 \, A b\right )} \sqrt {x}}{3 \, b^{2}}, \frac {2 \, {\left (3 \, {\left (B a - A b\right )} \sqrt {\frac {a}{b}} \arctan \left (\frac {b \sqrt {x} \sqrt {\frac {a}{b}}}{a}\right ) + {\left (B b x - 3 \, B a + 3 \, A b\right )} \sqrt {x}\right )}}{3 \, b^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x^(1/2)/(b*x+a),x, algorithm="fricas")

[Out]

[-1/3*(3*(B*a - A*b)*sqrt(-a/b)*log((b*x - 2*b*sqrt(x)*sqrt(-a/b) - a)/(b*x + a)) - 2*(B*b*x - 3*B*a + 3*A*b)*
sqrt(x))/b^2, 2/3*(3*(B*a - A*b)*sqrt(a/b)*arctan(b*sqrt(x)*sqrt(a/b)/a) + (B*b*x - 3*B*a + 3*A*b)*sqrt(x))/b^
2]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (66) = 132\).
time = 1.33, size = 221, normalized size = 3.20 \begin {gather*} \begin {cases} \tilde {\infty } \left (2 A \sqrt {x} + \frac {2 B x^{\frac {3}{2}}}{3}\right ) & \text {for}\: a = 0 \wedge b = 0 \\\frac {2 A \sqrt {x} + \frac {2 B x^{\frac {3}{2}}}{3}}{b} & \text {for}\: a = 0 \\\frac {\frac {2 A x^{\frac {3}{2}}}{3} + \frac {2 B x^{\frac {5}{2}}}{5}}{a} & \text {for}\: b = 0 \\- \frac {A a \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{b^{2} \sqrt {- \frac {a}{b}}} + \frac {A a \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{b^{2} \sqrt {- \frac {a}{b}}} + \frac {2 A \sqrt {x}}{b} + \frac {B a^{2} \log {\left (\sqrt {x} - \sqrt {- \frac {a}{b}} \right )}}{b^{3} \sqrt {- \frac {a}{b}}} - \frac {B a^{2} \log {\left (\sqrt {x} + \sqrt {- \frac {a}{b}} \right )}}{b^{3} \sqrt {- \frac {a}{b}}} - \frac {2 B a \sqrt {x}}{b^{2}} + \frac {2 B x^{\frac {3}{2}}}{3 b} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x**(1/2)/(b*x+a),x)

[Out]

Piecewise((zoo*(2*A*sqrt(x) + 2*B*x**(3/2)/3), Eq(a, 0) & Eq(b, 0)), ((2*A*sqrt(x) + 2*B*x**(3/2)/3)/b, Eq(a,
0)), ((2*A*x**(3/2)/3 + 2*B*x**(5/2)/5)/a, Eq(b, 0)), (-A*a*log(sqrt(x) - sqrt(-a/b))/(b**2*sqrt(-a/b)) + A*a*
log(sqrt(x) + sqrt(-a/b))/(b**2*sqrt(-a/b)) + 2*A*sqrt(x)/b + B*a**2*log(sqrt(x) - sqrt(-a/b))/(b**3*sqrt(-a/b
)) - B*a**2*log(sqrt(x) + sqrt(-a/b))/(b**3*sqrt(-a/b)) - 2*B*a*sqrt(x)/b**2 + 2*B*x**(3/2)/(3*b), True))

________________________________________________________________________________________

Giac [A]
time = 1.12, size = 64, normalized size = 0.93 \begin {gather*} \frac {2 \, {\left (B a^{2} - A a b\right )} \arctan \left (\frac {b \sqrt {x}}{\sqrt {a b}}\right )}{\sqrt {a b} b^{2}} + \frac {2 \, {\left (B b^{2} x^{\frac {3}{2}} - 3 \, B a b \sqrt {x} + 3 \, A b^{2} \sqrt {x}\right )}}{3 \, b^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*x^(1/2)/(b*x+a),x, algorithm="giac")

[Out]

2*(B*a^2 - A*a*b)*arctan(b*sqrt(x)/sqrt(a*b))/(sqrt(a*b)*b^2) + 2/3*(B*b^2*x^(3/2) - 3*B*a*b*sqrt(x) + 3*A*b^2
*sqrt(x))/b^3

________________________________________________________________________________________

Mupad [B]
time = 0.39, size = 76, normalized size = 1.10 \begin {gather*} \sqrt {x}\,\left (\frac {2\,A}{b}-\frac {2\,B\,a}{b^2}\right )+\frac {2\,B\,x^{3/2}}{3\,b}+\frac {2\,\sqrt {a}\,\mathrm {atan}\left (\frac {\sqrt {a}\,\sqrt {b}\,\sqrt {x}\,\left (A\,b-B\,a\right )}{B\,a^2-A\,a\,b}\right )\,\left (A\,b-B\,a\right )}{b^{5/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^(1/2)*(A + B*x))/(a + b*x),x)

[Out]

x^(1/2)*((2*A)/b - (2*B*a)/b^2) + (2*B*x^(3/2))/(3*b) + (2*a^(1/2)*atan((a^(1/2)*b^(1/2)*x^(1/2)*(A*b - B*a))/
(B*a^2 - A*a*b))*(A*b - B*a))/b^(5/2)

________________________________________________________________________________________